package com.honey.mybatis.generator.criteria.method;


import com.honey.compilation.java.Clazz;
import com.honey.compilation.java.Parameter;
import com.honey.core.dbmapping.introspect.IntrospectSchema;
import com.honey.core.dbmapping.introspect.IntrospectSchemaColumn;
import com.honey.core.types.JDKFullyQualifiedJavaType;
import com.honey.mybatis.generator.MybatisPlugin;
import com.honey.mybatis.generator.criteria.CriteriaConstant;

public class AndEqualToMethod extends BaseMethod {

	private static final String METHOD_NAME = "andEqualTo" ;
	
	private static final String[] JAVA_DOC = new String []{
		"使用and连接 = 条件(select update delete)。"
	};
	
	private static final  Parameter FIRST_PARAMETER = new Parameter(JDKFullyQualifiedJavaType.getObjectInstance(),"value");
	
	
	public AndEqualToMethod(){
	}
	public AndEqualToMethod(Clazz clazz, MybatisPlugin belongPlugin,
			IntrospectSchema introspectSchema,
			IntrospectSchemaColumn introspectSchemaColumn) {
		super(clazz, belongPlugin, introspectSchema, introspectSchemaColumn);
	}
		
	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractMethod#getMethodName()
	 */
	@Override
	protected String getMethodName() {
		return METHOD_NAME;
	}
	
	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.AbstractMethod#getJavaDoc()
	 */
	@Override
	protected String[] getJavaDoc() {
		return JAVA_DOC;
	}
	/*
	 * (non-Javadoc)
	 * @see com.honey.mybatis.generator.criteria.method.BaseMethod#getFirstParameter()
	 */
	@Override
	protected Parameter getFirstParameter() {
		return FIRST_PARAMETER;
	}
	
	
	public static void main(String []args){
		AndEqualToMethod  cm = new AndEqualToMethod();
		System.out.println(cm.createMethod().compiledContent(0)); 
	}
	
	@Override
	protected String getCondition() {
		
		return CriteriaConstant.EQUAL_TO_FIELD_NAME;
	}
}
